/**
 * 熵巡 - 企业级氚云OpenAPI数据管理平台
 * 开发归属 Alyr.net
 * 插件扩展样式 - 插件卡片、弹窗、表单
 * 尊重劳动成果是一种美德
 */

.plugin-container {
    margin-top: -20px;
}

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plugin-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    min-height: 120px;
}

.plugin-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.plugin-icon {
    display: none;
}

.plugin-info {
    flex: 1;
}

.plugin-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.plugin-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.plugin-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

/* 添加插件卡片样式 */
.add-plugin-card {
    border: 2px dashed #d0d0d0;
    background: #fafafa;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    text-align: center;
}

.add-plugin-card:hover {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.add-plugin-icon {
    display: none;
}

.add-plugin-text h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

.add-plugin-text p {
    margin: 0;
    font-size: 13px;
    color: #999;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content.modal-large {
    max-width: 1000px;
    width: 95%;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: white;
}

.close {
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.required {
    color: #e74c3c;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* ========================================== */
/* 插件配置页面通用样式 */
/* ========================================== */

/* 配置容器 */
.dingtalk-config-container,
.sms-config-container,
.wechat-config-container,
.feishu-config-container {
    padding: 0;
}

/* 表单样式 */
.dingtalk-form,
.sms-form,
.wechat-form,
.feishu-form {
    margin-top: 0;
    padding: 24px;
}

.dingtalk-form.disabled,
.sms-form.disabled,
.wechat-form.disabled,
.feishu-form.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* 开关按钮不受禁用影响 */
.dingtalk-form.disabled .switch,
.sms-form.disabled .switch,
.wechat-form.disabled .switch,
.feishu-form.disabled .switch {
    opacity: 1;
    pointer-events: auto;
}

.dingtalk-form.disabled input,
.dingtalk-form.disabled select,
.dingtalk-form.disabled button,
.sms-form.disabled input,
.sms-form.disabled select,
.sms-form.disabled button,
.wechat-form.disabled input,
.wechat-form.disabled select,
.wechat-form.disabled button,
.feishu-form.disabled input,
.feishu-form.disabled select,
.feishu-form.disabled button {
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* 开关内的checkbox不禁用 */
.dingtalk-form.disabled .switch input,
.sms-form.disabled .switch input,
.wechat-form.disabled .switch input,
.feishu-form.disabled .switch input {
    cursor: pointer;
    background-color: transparent;
}

/* 区块头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
}

/* 状态区域 */
.dingtalk-status,
.sms-status,
.wechat-status,
.feishu-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #333333;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

/* 表单项 */
.form-section .form-group {
    margin-bottom: 20px;
}

.form-section .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555555;
    font-weight: 500;
    font-size: 14px;
}

.form-section .form-group input,
.form-section .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    background-color: #ffffff;
    transition: border-color 0.3s;
}

.form-section .form-group input:focus,
.form-section .form-group select:focus {
    outline: none;
    border-color: #666666;
}

.form-section .form-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 按钮组 */
.button-group,
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.btn {
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid;
}

.btn-primary {
    background-color: #333333;
    color: #ffffff;
    border-color: #333333;
}

.btn-primary:hover {
    background-color: #555555;
    border-color: #555555;
}

.btn-secondary {
    background-color: #999999;
    color: #ffffff;
    border-color: #999999;
}

.btn-secondary:hover {
    background-color: #777777;
    border-color: #777777;
}

.btn-success {
    background-color: #333333;
    color: #ffffff;
    border-color: #333333;
}

.btn-success:hover {
    background-color: #555555;
    border-color: #555555;
}

/* 消息提示 */
.dingtalk-message,
.sms-message,
.wechat-message,
.feishu-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.dingtalk-message.show,
.sms-message.show,
.wechat-message.show,
.feishu-message.show {
    display: block;
}

.dingtalk-message.success,
.sms-message.success,
.wechat-message.success,
.feishu-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.dingtalk-message.error,
.sms-message.error,
.wechat-message.error,
.feishu-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.dingtalk-message.info,
.sms-message.info,
.wechat-message.info,
.feishu-message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}
